﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sispe.Entities;
using Sispe.BussinesLogic;
using Microsoft.Practices.Unity;

namespace Sispe.UI
{
    public partial class FrmHistorialTrabajador : Form
    {
        [Dependency]
        public IContratoBL contratoBL { get; set; }

        public FrmHistorialTrabajador()
        {
            InitializeComponent();
            this.BuildUp();
        }

        public TRABAJADOR CurrentTrabajador { get; set; }

        private void FrmHistorialTrabajador_Load(object sender, EventArgs e)
        {
            cargaData();
            nombreCompletoLabel1.Text = CurrentTrabajador.PERSONA.NombreCompleto;
        }

        public void cargaData()
        {
            cONTRATOBindingSource.DataSource = (from c in contratoBL.GetAllFromContratos()
                                                where c.IdTrabajador.Equals(CurrentTrabajador.Id)
                                                select c).ToList();
        }
    }
}
